subroutine check_range(nxec,nstp,e)
  use param
  implicit none
  integer,intent(in) :: nxec,nstp
  real(dbl),intent(in) :: e
  real(dbl) :: e1,e2,tn
  integer :: td,p
  read(nxec,rec=2) e1
  read(nxec,rec=3) tn
  td=int(tn)
  p=2*tn+2
  read(nxec,rec=p) e2
  if (e1.ne.e2) then
     stop 'check_range 1'
  else
  end if
  if (e1.lt.e) then
     write(*,'("Err-check_ragne-Energy=",1pe9.3,"is out of range.(xsec)")') e
     stop
  end if
  read(nstp,rec=2) e1
  read(nstp,rec=3) tn
  td=int(tn)
  p=2*tn+2
  read(nstp,rec=p) e2
  if (e1.ne.e2) then
     stop 'check_range 2'
  end if
  if (e1.lt.e) then
     write(*,'("Err-check_ragne-Energy=",1pe9.3,"is out of range.(nstop)")') e
     stop
  end if
end subroutine check_range
